package com.zhiyou100.action;

import com.github.pagehelper.PageInfo;
import com.zhiyou100.entity.Rose;
import com.zhiyou100.service.PageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 分页插件测试
 *
 * @author yang
 * @version 1.0.0
 * @date 2020-09-05 21:19
 */

@RequestMapping("/page")
@Controller

public class PageHelp {
    @Autowired
    private PageService service;

    @ResponseBody
    @RequestMapping("/getAllPagination.action")
    public PageInfo<Rose> getAll(@RequestParam(defaultValue = "1") int page) {
        return service.getAll(page);
    }
}
